package com.ruoyi.website.gateway.feign;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;


//@FeignClient(name = "ruoyi-forum")
public interface CircleReplyService {


    @Operation(summary = "点赞", description = "点赞")
    @Parameters({
            @Parameter(name = "id", description = "动态id", required = true),
            @Parameter(name = "uid", description = "用户id", required = true)
    })
    @RequestMapping(value = "circle/topic/great", method = RequestMethod.POST)
    public AjaxResult greatTopic(@RequestParam(value = "id") Long id, @RequestParam(value = "uid") String uid);


    @Operation(summary = "取消点赞", description = "取消点赞")
    @Parameters({
            @Parameter(name = "id", description = "动态id", required = true),
            @Parameter(name = "uid", description = "用户id", required = true)
    })
    @RequestMapping(value = "circle/topic/ungreat", method = RequestMethod.POST)
    public AjaxResult ungreatTopic(@RequestParam(value = "id") Long id, @RequestParam(value = "uid") String uid);


    @Operation(summary = "评论", description = "评论")
    @Parameters({
            @Parameter(name = "id", description = "动态id", required = true),
            @Parameter(name = "uid", description = "用户id", required = true),
            @Parameter(name = "content", description = "评论内容", required = true),
            @Parameter(name = "replyTo", description = "回复对象用户id"),
            @Parameter(name = "operateType", description = "0-用户回复 1-平台回复"),
            @Parameter(name = "replyId", description = "回复id")
    })
    @RequestMapping(value = "circle/topic/reply", method = RequestMethod.POST)
    public AjaxResult replyTopic(@RequestParam(value = "id") Long id, @RequestParam(value = "uid") String uid,
                                 @RequestParam(value = "content") String content,
                                 @RequestParam(value = "replyTo", required = false) String replyTo,
                                 @RequestParam(value = "operateType", required = false) Integer operateType,
                                 @RequestParam(value = "replyId", required = false) Long replyId);


    @Operation(summary = "删除我的评论", description = "删除我的评论")
    @Parameters({
            @Parameter(name = "id", description = "评论id", required = true),
            @Parameter(name = "uid", description = "用户id", required = true)
    })
    @RequestMapping(value = "circle/topic/my/reply/delete", method = RequestMethod.POST)
    public AjaxResult deleteMyReply(@RequestParam(value = "id") Long id, @RequestParam(value = "uid") String uid);


    @Operation(summary = "获取动态点赞或回复列表", description = "获取动态点赞或回复列表")
    @Parameters({
            @Parameter(name = "id", description = "动态id", required = true),
            @Parameter(name = "type", description = "类型 0：点赞 1：回复", required = true),
            @Parameter(name = "page", description = "页码", example = "1"),
            @Parameter(name = "rows", description = "条数", example = "10")
    })
    @RequestMapping(value = "circle/topic/communication/list", method = RequestMethod.GET)
    public TableDataInfo getTopicCommunicationPage(@RequestParam(value = "id") Long id,
                                                   @RequestParam(value = "type") Integer type,
                                                   @RequestParam(value = "page", defaultValue = "1", required = false) Integer pageNo,
                                                   @RequestParam(value = "rows", defaultValue = "10", required = false) Integer rows);
}